<?php

namespace app\shop\exception;

use app\shop\library\response\ResponseCode;
use Throwable;

class AuthExpireException extends CustomException
{
    /**
     * 认证过期异常
     * @param string         $errorMsg     错误提示
     * @param int|null       $businessCode 错误业务码
     * @param Throwable|null $previous
     */
    public function __construct(
        string $errorMsg = ResponseCode::AUTHORIZED_EXPIRED['msg'],
        int $businessCode = null,
        Throwable $previous = null,
    ) {
        $this->httpStatus   = ResponseCode::AUTHORIZED_EXPIRED['code'];
        $this->businessCode = $businessCode ?? ResponseCode::AUTHORIZED_EXPIRED['code'];
        $this->errorMsg     = $errorMsg ?? ResponseCode::AUTHORIZED_EXPIRED['msg'];

        parent::__construct($this->errorMsg, $previous);
    }
}
